package com.basics.channel.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.basics.api.response.channel.CommentListData;
import com.basics.api.response.channel.PostCommentListData;
import com.basics.channel.entity.CyChannelComment;
import com.baomidou.mybatisplus.extension.service.IService;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 帖子评论 服务类
 * </p>
 *
 * @author WangWei
 * @since 2025-03-09
 */
public interface CyChannelCommentService extends IService<CyChannelComment> {

    /**
     * 获取最新3条评论
     * @param postId
     * @return
     */
    List<CommentListData> selectPostCommentList(Long postId);

    /**
     * 根据帖子ID获取评论数量
     * @param postId
     * @return
     */
    int getCommentNumByPostId(Long postId);

    /**
     * 根据帖子ID获取评论列表
     * @param page
     * @param postId
     * @param userId
     * @return
     */
    IPage<PostCommentListData> selectCommentList(Page page, Long postId, Long userId,Integer commentType,
                                                 String parentId);
}
